home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / dev / lang / pcq12b.lzh / Include / Devices / Timer.i < prev    next >
Text File  |  1991-03-27  |  1KB  |  61 lines

  1. {
  2.     Timer.i for PCQ Pascal
  3. }
  4.  
  5. {$I "Include:Exec/IO.i"}
  6.  
  7. Const
  8.  
  9. { unit defintions }
  10.     UNIT_MICROHZ    = 0;
  11.     UNIT_VBLANK        = 1;
  12.  
  13.     TIMERNAME        = "timer.device";
  14.  
  15. Type
  16.  
  17.     timeval = record
  18.     tv_secs        : Integer;
  19.     tv_micro    : Integer;
  20.     end;
  21.     timevalPtr = ^timeval;
  22.  
  23.  
  24.     timerequest = record
  25.     tr_node        : IORequest;
  26.     tr_time        : timeval;
  27.     end;
  28.     timerequestPtr = ^timerequest;
  29.  
  30. Const
  31.  
  32. { IO_COMMAND to use for adding a timer }
  33.     TR_ADDREQUEST    = CMD_NONSTD;
  34.     TR_GETSYSTIME    = CMD_NONSTD + 1;
  35.     TR_SETSYSTIME    = CMD_NONSTD + 2;
  36.  
  37. {  To use any of the routines below, TimerBase must be set to point
  38.    to the timer.device, either by calling CreateTimer or by pulling
  39.    the device pointer from a valid TimeRequest, i.e.
  40.  
  41.     TimerBase := TimeRequest.io_Device;
  42.  
  43.     _after_ you have called OpenDevice on the timer.
  44.  }
  45.  
  46. var
  47.     TimerBase    : Address;
  48.  
  49. { Dest := Dest + Source }
  50.  
  51. Procedure AddTime(VAR Dest, Source : TimeVal);
  52.     External;
  53.  
  54. Function CmpTime(VAR Dest, Source : TimeVal) : Integer;
  55.     External;
  56.  
  57. { Dest := Dest - Source }
  58.  
  59. Procedure SubTime(VAR Dest, Source : TimeVal);
  60.     External;
  61.